package com.it.controller;

import com.it.pojo.Man;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
//@ConfigurationProperties(prefix = "man") //需要搭配getset使用
public class HelloController {

    @Value("${company1}")
    private String company1;
    @Value("${company2}")
    private String company2;

    @Value("${msg1}")
    private String msg1;
    @Value("${msg2}")
    private String msg2;



    @RequestMapping("hello")
    public String hello() {
        return "Hello Spring Boot!"+company1+"   "+msg2;
    }


 /*   *//**
     * 注解ConfigurationProperties的获取值方法
     *//*
    private String userName;
    private String boss;
    private String birth;
    private String age;
*/


    @Autowired
    private Man man;

    @RequestMapping("hello1")
    public Man hello1() {
        return man;
    }
}
